<?php
	include_once 'isLogin.php';	
	$user='user';
	$userc=new user();
	
	//删除
	if($_GET['action']=="del"){
		$user_ids=$_POST['id']?substr($_POST['id'],0,-1):$_GET['id'];
		$res=$userc->delUser($user_ids);
		echo $res;
		exit();
	}

	$smarty->assign('search',$_GET);

	//会员列表
	$where='';
	if($_GET['account']!='') $where.=' and u.account like "%'.$_GET['account'].'%"';
	if($_GET['phone']!='') $where.=' and u.phone = "'.$_GET['phone'].'"';
	$where.=' order by u.id desc';
	$key='u.*,FROM_UNIXTIME(u.reg_time,"%Y-%m-%d") as regTime';
	$user=$userc->userList($where,$key,1);

	
	$smarty->assign("user",$user['result']);
	$smarty->assign('page',$user['page']);
	$smarty->display("user_list.html");
?>